/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ControlLayer;

import DBLayer.DBInvoiceStatus;
import DBLayer.IFDBInvoiceStatus;
import ModelLayer.Invoice;
import ModelLayer.InvoiceStatus;

/**
 *
 * @author Henrik-iMac
 */
public class CtrInvoiceStatus {

    public CtrInvoiceStatus() {
    }

    public InvoiceStatus findInvoiceStatusByInvoiceId(int invoiceId, boolean retrieveAssociation){
        IFDBInvoiceStatus dbInv = new DBInvoiceStatus();
        return dbInv.findInvoiceStatusByInvoiceId(invoiceId, retrieveAssociation);
    }

    public int insertInvoiceStatus(InvoiceStatus invoiceStatus){
        IFDBInvoiceStatus dBInvoiceStatus = new DBInvoiceStatus();
        return dBInvoiceStatus.insertInvoiceStatus(invoiceStatus);
    }

    public int updateInvoiceStatus(Invoice invoiceId, String status){
        IFDBInvoiceStatus dBInvoiceStatus = new DBInvoiceStatus();
        InvoiceStatus invoiceStatus = new InvoiceStatus();
        invoiceStatus.setInvoiceId(invoiceId);
        invoiceStatus.setStatus(status);
        return dBInvoiceStatus.updateInvoiceStatus(invoiceStatus);
    }

}
